package com.testfileupload.uploadimg.design.chainofresponsibility.correct;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Client {
    public static void main(String[] args) {
        //随机挑选几个女性
        Random random = new Random();
        List<IWomen> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            IWomen women = new Women(random.nextInt(4), "逛街");
            list.add(women);
        }
        //定义三个请求对象
        Handler father = new Father();
        Handler son = new Son();
        Handler husband = new Husband();
//        顺序
        father.setNext(husband);
        husband.setNext(son);
        for (IWomen women : list) {
            father.handleMessage(women);
        }
    }
}
